 package com.cxl.sort;

public class BubbleSort
 {
   public static void main(String[] arg)
   {
     int[] array = { 34, 123, 234, 2, 3, 45, 234 };
     int flag = 1;
     int j;
     int tmp;
     for (int i = 0; i < array.length - 1; i++) {
       flag = 0;
       for (j = 0; j < array.length - i - 1; j++) {
         if (array[j] > array[(j + 1)]) {
           tmp = array[(j + 1)];
           array[(j + 1)] = array[j];
           array[j] = tmp;
           flag = 1;
         }
       }
       if (flag == 0) {
         break;
       }
     }
     for (int s : array)
       System.out.println(s);
   }
 }

/* Location:           E:\work\eclipse3.6_\workspace\design_pattern\
 * Qualified Name:     com.cxl.sort.BubbleSort
 * JD-Core Version:    0.6.1
 */